Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rattler_menuinst crate #840

Draft
wants to merge 81 commits into
base: main
Choose a base branch
from
Draft

feat: add rattler_menuinst crate #840

wants to merge 81 commits into from

Conversation

wolfv
Copy link
Contributor

@wolfv wolfv commented Aug 31, 2024

TODO:

  • run precreate code if specified in the menuinst
  • fix the XML editing for Linux!
  • Windows activation running

Some notes:

  • on linux, there are no icons that are installed for mime types. I think it could be done relatively easily with something like https://stackoverflow.com/questions/30931/register-file-extensions-mime-types-in-linux
  • we call xdg-mime to install the xml file. This automatically also updates the mime database. But it makes it harder to test, because that installs to user directory we should test by overriding XDG_DATA_DIRECTORY and XDG_CONFIG_DIRECTORY 💡

@wolfv
Copy link
Contributor Author

wolfv commented Nov 8, 2024

Apparently the name can be a dict:

            "name": {
                "target_environment_is_base": "superspyder 1.2 ({{ DISTRIBUTION_NAME }})",
                "target_environment_is_not_base": "superspyder 1.2 ({{ ENV_NAME }})"
            },

@wolfv wolfv changed the title Start menuinst crate feat: add rattler_menuinst crate Nov 9, 2024
@Hofer-Julian
Copy link
Collaborator

Linux is now nearly working.

Running cargo run -- create napari-menu gives the following desktop file in .local/share/applications/napari (0.5.4).desktop

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=napari (0.5.4)
Exec=unset PYTHONHOME && unset PYTHONPATH && /var/home/julian/Projekte/github.com/conda/rattler/.prefix/bin/python -m napari
Terminal=false
Icon=/var/home/julian/Projekte/github.com/conda/rattler/.prefix/Menu/napari.png
Comment=a fast n-dimensional image viewer in Python
Categories=Graphics;Science;
StartupWMClass=napari

Exec doesn't support complicated expressions like this one. We should extract that to a script or trampoline.

@Hofer-Julian
Copy link
Collaborator

We went with directly calling the quoted command with bash -c instead.

One thing that still needs to be investigated if we need to run update-desktop-database after installing, my system gives unclear results. We could run it just to be sure. Mimetypes would be also great to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants